package com.greenline.push.dal.pushcenter.impl;

import com.greenline.push.dal.base.BaseDAO;
import com.greenline.push.dal.pushcenter.ClassDefineDAO;
import com.greenline.push.dal.pushcenter.dataobject.ClassDefineDO;
import com.greenline.push.dal.query.ClassDefineQuery;

public class ClassDefineDAOImpl extends BaseDAO implements ClassDefineDAO {

    @Override
    public Long insert(ClassDefineDO classDefineDO) {
        return (Long) super.getSqlMapClientTemplate().insert("classDefine.insert", classDefineDO);
    }

    @Override
    public ClassDefineDO getClassDefineById(Long id) {
        return (ClassDefineDO) super.getSqlMapClientTemplate().queryForObject("classDefine.find_by_id", id);
    }

    @Override
    public int update(ClassDefineDO classDefineDO) {
        return super.getSqlMapClientTemplate().update("classDefine.update", classDefineDO);
    }

    @Override
    public ClassDefineQuery listByQuery(ClassDefineQuery query) {
        return (ClassDefineQuery) super.listByQuery("classDefine.list_by_query", query);
    }

    @Override
    public int delete(Long id) {
        return super.getSqlMapClientTemplate().delete("classDefine.delete", id);
    }

    @Override
    public ClassDefineDO getClassDefineByName(String name) {
        return (ClassDefineDO) super.getSqlMapClientTemplate().queryForObject("classDefine.find_by_name", name);
    }

	@Override
	public ClassDefineDO getClassDefineByCode(String code) {
		return (ClassDefineDO) super.getSqlMapClientTemplate().queryForObject(
				"classDefine.find_by_code", code);
	}

}
